<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="36-03-手写Promise-then原型方法-异步修改状态.js"></script>
</head>

<body>
    <script>
        let p = new Promise((resolve,reject)=>{
            setTimeout(() => {
                resolve('success'); 
                // reject('error');
            }, 1000);           
        });

        console.log(p);

        // p 实例对象 实例对象下的方法都存在prototype上面
        p.then(val=>{
            console.log(val);
        },rea=>{
            console.log(rea);
        });

        p.then(val=>{
            console.log(val);
        },rea=>{
            console.log(rea);
        });

        p.then(val=>{
            console.log(val);
        },rea=>{
            console.log(rea);
        });


       

    </script>
</body>

</html>